package com.yj.springbootstudy.config.profile;

import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.Arrays;

@Service
@Profile("java8")
public class Java8CalculateServiceImpl implements CalculateService {
    @Override
    public Integer sum(Integer... value) {
        Integer result = Arrays.stream(value).reduce(0, Integer::sum);
        return result;
    }
}
